using System;
using System.Text.RegularExpressions;

namespace NetQueryLib.Expressions
{
	public class IDSelectorExpressionBuilder : SelectorExpressionBuilder
	{
		public override bool AppliesTo(string selector)
		{
			return Regex.IsMatch(selector, @"^[a-zA-Z0-9\-]*#[a-zA-Z0-9\-]+$");
		}

		public override SelectorExpression Build(string selector)
		{
			return new IDSelectorExpression(selector);
		}
	}
}